<!--
    -  Copyright (c) 2018-2025, haohanwork.com All rights reserved.
  -->
<template>
  <div class="execution">
    <basic-container>
      <h1 class="io-goods-detail">调拨详情</h1>
      <h2 class="io-goods-detail">基础信息</h2>
      <template>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6">
            <div class="grid-content bg-purple">单号:{{basicInformation.purchaseOrderId}}</div>
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple-light">调入仓库:{{basicInformation.checkStatus}}</div>
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple-light">调出仓库:{{basicInformation.checkStatus}}</div>
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple"></div>
            调拨状态:{{basicInformation.purchaseType}}
          </el-col>
        </el-row>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6">
            <div class="grid-content bg-purple-light"></div>
            创建日期:{{basicInformation.supplierName}}
          </el-col>
          <el-col :span="6">
            <div class="grid-content bg-purple-light">制单人:{{basicInformation.purchaseEmployee}}</div>
          </el-col>
        </el-row>
      </template>
    </basic-container>
    <basic-container>
      <h2 class="io-goods-detail">单据详情</h2>
      <template>
        <el-table :data="tableData" border show-summary style="width: 100%">
          <el-table-column prop="id" label="序号" type="index" width="180px"></el-table-column>
          <el-table-column prop="goods" label="商品"></el-table-column>
          <el-table-column prop="unit" sortable label="单位"></el-table-column>
          <el-table-column prop="sum" label="库存"></el-table-column>
          <el-table-column prop="unitPrice" sortable label="数量"></el-table-column>
          <el-table-column prop="money" sortable label="进价"></el-table-column>
        </el-table>
      </template>
    </basic-container>
    <basic-container>
      <template>
        <div class="return-btn">
          <el-button type="primary" plain @click="backup">返回</el-button>
        </div>
      </template>
    </basic-container>
  </div>
</template>
<!-- 采购退货 -->
<script>
import {
  queryEnterWarehouseDetail
} from "@/api/scm/warehouse/warehouseallot";
import { mapGetters } from "vuex";
import Util from '@/util/pds/utils'
let cookieUtil = new Util();
export default {
  name: "addpurchaseback",
  data() {
    return {
      tableData: [],
      otherMoney: 100,
      calcMoney: 1000,
      basicInformation: {
        purchaseOrderId: "POI10000",
        checkStatus: "待审核",
        purchaseType: "平台直购",
        supplierName: "浩瀚小店",
        deliveryTime: "2019-03-09",
        purchaseEmployee: "张**",
        makeBill: "运营"
      },
    };
  },
  computed: {
    ...mapGetters(["permissions"])
  },
  created(){
    this.init();
  },
  methods: {
    init() {
      let param = {};
      param.pmId=this.getStore({name: "pmId"});
      param.warehouseAllotSn = this.$route.query.warehouseAllotSn.warehouseAllotSn;
      this.basicInformation = this.$route.query.warehouseAllotSn;
      queryEnterWarehouseDetail(param).then(res =>{
        this.tableData = res.data.data;
      })
    },
    backup: function() {
      this.$router.go(-1);
    }
  }
};
</script>

<style lang="scss" scoped>
.io-goods-detail {
  margin-left: 10px;
}
.settle-accounts {
  text-align: right;
}
.basic-information {
  margin-top: 20px;
  font-weight: inherit;
}
.return-btn {
  height: 100px;
  width: 100%;
  text-align: center;
  line-height: 100px;
}
</style>
